package controllers;

import java.util.Map;

import dto.retjson.RetDataDto;
import play.libs.Json;
import play.mvc.*;
import service.AfforestationTypeRegService;
import util.MVCUtils;

public class AfforestationTypeController extends Controller {
	public static Result registerAfforestationType() {
		try {
			//注册
			Map<String, String> afforestationTypeRegInfoArgs = MVCUtils.getRequestArgs(request());
			AfforestationTypeRegService.registerInfo(afforestationTypeRegInfoArgs);
		} catch (Exception e) {
			//注册失败
			e.printStackTrace();
			return ok(Json.toJson(new RetDataDto(false, e.getMessage())));
		}
		return ok(Json.toJson(new RetDataDto()));
	}
}
